xml.instruct! :xml, :version => "1.0", :encoding => "UTF8"
xml.objectives("user_id" => @user.id, "user_login" => @user.login) {
  @results.each do |result|
    xml.objective("id" => result[:objective].id,
                  "protocol_id" => result[:protocol].id,
                  "timerange" => result[:objective].time_range,
                  "days" => result[:objective].days,
                  "months" => result[:objective].months,
                  "location_id" => result[:objective].location,
                  "location_name" => result[:objective].location_name,
                  "location_coords" => result[:objective].location_coords) unless result[:objective].nil?
  end

}